import { createApp } from 'vue';
import App from './App.vue';
import {setupStore} from "@/store/index.js";
import {setupRouter} from "@/router/index.js";
import {
    setupElement,
    setupAssets,
    setupCustomComponents,
    setupGlobalMethods
} from '@/plugins/index.js';
import directive from '@/directive';

const app = createApp(App);
function  setupPlugins() {
    //引入静态资源
    setupAssets();
    //注册全局常用的element ui 组件
    setupElement(app);
    //注册全局自定义组件
    setupCustomComponents(app);
    //注册全局方法
    setupGlobalMethods(app);
    //注册操作按钮权限
    directive(app);
}
async function setupApp() {
    //初始化pinia
    setupStore(app);
    //初始化路由
    await setupRouter(app);
    app.mount('#app');
}
setupPlugins();
setupApp().then();
